package com.sims.action.attendanceRecord;

import org.springframework.beans.factory.annotation.Autowired;

import com.sims.bean.AttendanceRecord;
import com.sims.service.AttendanceRecordService;
import com.sims.util.ActionEnhanced;
import com.sims.util.Constant;

@SuppressWarnings("serial")
public class AddAttendanceRecordAction extends ActionEnhanced{
	
	private AttendanceRecord attendanceRecord = new AttendanceRecord();
	
	@Autowired
	private AttendanceRecordService attendanceRecordService;
	
	
	public AttendanceRecord getAttendanceRecord() {
		return attendanceRecord;
	}

	public void setAttendanceRecord(AttendanceRecord attendanceRecord) {
		this.attendanceRecord = attendanceRecord;
	}


	@Override
	public String execute() {
		
		result = attendanceRecordService.addAttendanceRecord(attendanceRecord);
		if (result.containsKey(Constant.SUCCESS)) {
			System.out.println("success");
			return SUCCESS;
		}
		return ERROR;
	}
}
